﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using QxFramework.Core;
using System;
public class ScanCircle : EffectBase 
{
    float RadiusSpeed =540;
    string followItemName = default;
    private void FixedUpdate()
    {
        this.transform.localEulerAngles = new Vector3(0, 0, this.transform.localEulerAngles.z + RadiusSpeed * Time.fixedDeltaTime);
        if (ClockManager.Get<IItemSyncManager>().GetGameObjectByName(followItemName) != null)
        {
            this.transform.position = ClockManager.Get<IItemSyncManager>().GetGameObjectByName(followItemName).transform.position;
        }
    }
    public override void OnDisplay(Vector3 pos, object arg = null)
    {
        base.OnDisplay(pos, arg);
        var info = arg as Tuple<string, float>;
        this.transform.localScale = Vector3.one * info.Item2;
        followItemName = info.Item1;
    }
}
